package com.bw.base

import android.app.Application
import android.content.Context
import com.alibaba.android.arouter.launcher.ARouter
import com.bw.base.BuildConfig
import com.bw.base.constants.ApiConst
import com.tencent.mmkv.MMKV
import com.umeng.commonsdk.UMConfigure
import com.umeng.socialize.PlatformConfig

open class BaseApp :Application(){

//    lateinit var appContext:Application
//
//    override fun attachBaseCon        text(base: Context?) {
//        super.attachBaseContext(base)
//        if(base!=null){
//            appContext = base as Application
//        }
//    }

    override fun onCreate() {
        super.onCreate()

        UMConfigure.init(this, "66f65317667bfe33f3b60138", "umeng", UMConfigure.DEVICE_TYPE_PHONE, "");
        // QQ设置
        PlatformConfig.setQQZone("101830139","5d63ae8858f1caab67715ccd6c18d7a5");

        if(BuildConfig.DEBUG){
            ARouter.openDebug()
            ARouter.openLog()

        }



        ARouter.init(this)

        MMKV.initialize(this)

        MMKV.defaultMMKV().encode(ApiConst.PARAM_ACCESS_ID,"b97cd69ea18f41e69826821fc2d84bd1")


    }
}